import {createBrowserRouter} from 'react-router-dom';
import App from '../App';
import BodyHomePage from '../containers/BodyHomePage/BodyHomePage';
import HomePage from '../containers/HomePage/HomePage';
import Login from '../components/LoginPage/Login';
import Article from '../components/Article/Article';
import Community from '../components/Community/Community';
import SuperClub from '../components/SuperClub/SuperClub';
import Money from '../components/Money/Money';
import RankingList from '../components/RankingListPage/RankingList';
import ArticleContent from '../components/ArticleContent/ArticleContent';
import Comment from '../components/Comment/Comment';
import Pagination from '../components/Pagination/Pagination';

// 创建router实例对象并且配置路由对应关系
const router = createBrowserRouter([
    {//初始化页面（导航栏，浏览器底部， ）
        path: '/',
        element: <App/>,
        children: [{//首页（默认的主体内容）
            index: "true",
            element: <BodyHomePage/>,
            children: [{//首页（默认的主体内容）
                index: "true",
                element: <HomePage/>
            }, {//问答
                path: "Article",
                element: <>
                    <Article/>
                    <Pagination/>
                </>
            }, { //社区
                path: "Community",
                element: <Community/>
            }, {//超级社团
                path: "SuperClub",
                element: <SuperClub/>
            }, {//页面内容
                path: "ArticleContent/:id",
                element: <ArticleContent/>
            },
            ]//===========================
        }, {//余额充值
            path: "Money",
            element: <Money/>
        }, {// 登陆注册
            path: 'login',
            element: <Login/>
        }, {//排行榜
            path: "RankingList",
            element: <RankingList/>
        }, {//评论组件（test）
            path: "Comment",
            element: <Comment/>
        }, {
            // children: [{
            //     index: "true",
            //     element: <HomePage />
            // },{//首页（默认的主体内容）
            //     index: "true",
            //     element: <HomePage />
            // },
            // ]
        },
        ]
    }
])
export default router;